#include "common.h"

#include <sys/ipc.h>
#include <sys/shm.h>
#include <string.h>

int main()
{
	key_t key = ftok("./", 18);
	int shmid = shmget(key, 1024, IPC_CREAT);
	char *shmdata = shmat(shmid, NULL, 0);

	if(shmid < 0)
		err_sys("create shm faile\n");

	while(1)
	{
		sleep(1);
		bzero(shmdata, 1024);
		strcpy(shmdata, "write to shmdata");
	}

	return 0;
}
